package com.jinghua.treatment.service.impl;

import com.jinghua.treatment.entity.SysDoctorNoticeSetting;
import com.jinghua.treatment.entity.SysDoctorNoticeSettingExample;
import com.jinghua.treatment.mapper.SysDoctorNoticeSettingMapper;
import com.jinghua.treatment.service.DoctorNoticeSettingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoctorNoticeSettingServiceImpl implements DoctorNoticeSettingService {

    @Resource
    SysDoctorNoticeSettingMapper sysDoctorNoticeSettingMapper;

    @Override
    public SysDoctorNoticeSetting findNoticeSettingByDoctorId(Integer doctorId) {
        SysDoctorNoticeSettingExample sysDoctorNoticeSettingExample = new SysDoctorNoticeSettingExample();
        SysDoctorNoticeSettingExample.Criteria sysDoctorNoticeSettingCriteria=sysDoctorNoticeSettingExample.createCriteria();
        sysDoctorNoticeSettingCriteria.andDoctorIdEqualTo(doctorId);
        List<SysDoctorNoticeSetting> results = sysDoctorNoticeSettingMapper.selectByExample(sysDoctorNoticeSettingExample);
        return results==null?null:results.get(0);
    }
}
